/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.ac.iie.di.commons.speeder.monitor.handler;

import java.util.Collections;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

/**
 *
 * @author zwlin
 */
@FunctionalInterface
public interface StatHandler<T> extends BiConsumer<String, T>, Consumer<Map<String, T>> {

    @Override
    public void accept(Map<String, T> statMap);

    @Override
    public default void accept(String key, T value) {
        accept(Collections.singletonMap(key, value));
    }

}
